import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

 /**
 * Created by :Infaraway
 * DATE : 2017/3/25
 * Time : 14:34
 * Funtion : session对象的销毁
 */
public class DeleteSession extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session = request.getSession(false);
		if(session!=null){
			session.invalidate();//销毁一个session对象
		}
		System.out.println("删除session成功！");
	}

}
